Real-Time Control of an Electric Vehicle Charging Station While Tracking an Aggregated Power-Setpoint

ABSTRACT

An electric vehicle (EV) charging method which considers the EVs heterogeneity, taking into account the absence of any information about future arrivals and departures, and of the amount of time any charging will take. The method further considers both switch on and off possibilities and not an arbitrarily small minimum charging power. In order to achieve all these objectives, the invention defines novel metrics and uses them to construct a dedicated optimization problem. As the charging power is discontinuous, the minimum charging power not being arbitrarily small, the optimization problem is mixed integer by nature. Further, because the mixed-integer optimization is difficult to perform in real-time, the invention proposes a heuristic for reducing the number of integer variables, thus reducing the complexity of the problem.

FIELD OF INVENTION

The invention is in the field of control of the charging of electricvehicles.

BACKGROUND

The penetration of electric vehicles (EVs) in the market is expected todramatically increase in the next decade. For example, given an expectedsale growth of 20%, there will be more than four million EVs in USA by2024 [1]. This will affect the planning and operation of electricalgrids with particular reference to distribution networks. Indeed,uncoordinated and random EV-charging may largely impact supply qualityand continuity. In such case, power flows and voltage-quality patternsthroughout the grid will be affected considerably [2], and mightincrease the risk of local blackouts due to overloads. The authors in[3]-[7] show how uncontrolled charging of EVs might jeopardize theoperation of the power grid, causing voltage deviations or increasingpower system losses [8], [9].

For example, consider a potentially common situation of a distributionnetwork that contains local generation (PV panels) and an EVcharging-station (CS), both connected to the main grid through atransformer. When EVs are mostly charged by the PV production, a rapidPV power-drop (that could reach up to 60% of the rated power in fewseconds [10]) will suddenly increase the power flow through thetransformer. This might cause the transformer to exceed its rated power.Alternatively, the CS can reduce its charging power to compensate forthe solar drop. However, this requires the CS to constantly update,given external conditions, the maximum charging-power it can consume. Tocope with such situations, the nave approach would be for the CS to knowthe precise amount of PV injected-power, and the transformerrated-power. Yet, this solution is not scalable. An alternative is touse a grid controller with explicit power-setpoints (e.g., [11]). Inthis case, the CS only needs to follow a power setpoint and allocatethis aggregated power-setpoint among the connected EVs. For the gridcontroller to compute valid setpoints, it should be informed about theflexibility of all controlled resources. Since the flexibility of the CSdepends on the situation (number and type of connected EVs,State-of-Energy of EV batteries, etc.), it has to be updated repeatedly.

The allocation of power to EVs is a difficult task since, as previouslymentioned, an aggregated power-setpoint can change dramatically in fewseconds. The naive power allocation, which would transfer thesevariations directly to EVs, could increase their battery ageing bycreating large power-jumps, mini-cycles, as well as frequent on-offswitching of EVs. Moreover, the power should be allocated fairlyconsidering that each EV has its own energy demand and remaining time atthe CS. Indeed, due to the decisions of the local-grid controller, theaggregated power-setpoint might not be enough to satisfy the demand ofall EVs. Authors in [12] minimize the battery-degradation costassociated to additional cycling, assuming that there is sufficientamount of power to satisfy the EVs demand, hence fairness issues are notaddressed. Studies in [13]-[15], on the contrary, propose chargingschemes that consider fairness of the power allocation among EVs, thoughwithout accounting for battery wearing.

Accordingly, it is one aim of the invention to consider both batterywearing and fair-demand satisfaction, while tracking the aggregatedpower-setpoint.

Furthermore, the battery sizes, charging rates, initial and desireddeparture State-of-Energy, can be different for every EV. The authors in[16] propose a load-management control strategy for minimizing the powerlosses and improving the voltage profile during peak hours by assumingthat EVs are scheduled in three different types of charging periods. Theauthors in [17] develop a decentralized control-scheme, using conceptsfrom non-cooperative games, showing optimality when the EVscharacteristics are identical (same departure time, energy demand andmaximum charging-power) and all charging schedules are agreed upon withthe CS one-day ahead. [18] proposes an online charging-algorithmassuming that no EVs will arrive when a charging schedule is made.Furthermore, studies [2], [19], [20] assume that all the EVs have thesame charging rate. However, such assumptions do not hold in practice.

It is a further aim of the invention to take into account that we do nothave any information about future arrivals and departures, nor can weknow the amount of time any charging will take.

Additionally, a common assumption in the literature is that the chargingpower of an EV is a continuous value between 0 and the maximum power(e.g., [15], [19], [20]). However, in reality, this is not the casebecause an EV can be either switched off and consume no power, or chargeat a power that lies between non-zero bounds, where the minimumcharging-power cannot be arbitrarily small. The authors in [22]developed a distributed control-scheme that support on-off states, butis limited to a constant power when on.

It is a further aim of the invention to take into account both switch onand off possibilities and not any arbitrarily small minimum chargingpower.

In other words, the invention has the following objectives: (i) followan aggregated power-setpoint, (ii) minimize the battery degradation ofeach EV and (iii) fairly allocate the power proportional to the EVsneeds.

SUMMARY OF INVENTION

In a first aspect, the invention provides a method for controlling thecharging of at least an electrical vehicles (EVs) connected to a singlecharging station (CS), whereby the at least one electrical vehicle maybe either locked or unlocked, an EV being locked if it is in the processof reacting or implementing a setpoint. The method comprisescontinuously tracking at the charging station of a number of the atleast one electric vehicle connected; controlling from the chargingstation a charging power of each EV by sending a setpoint P_(i)[k] to anEV i at time k; receiving at the charging station a measured power{circumflex over (P)}_(i)[k] from each EV i at time k; computing at agrid controller for all EVs that are not locked at the time k, anaggregated power-setpoint P^(req)[k] in real time; receiving at thecharging station the aggregated power-setpoint P^(req)[k] at any time k;sending from the charging station to the grid controller a chargingstation power flexibility interval, the latter being a power range whichthe charging station is configured to implement; allocating an overallconsumed power fairly among the connected EVs by solving the followingoptimisation problem:

$\begin{matrix}{(P)\mspace{709mu}} & \; \\\left. {\min\limits_{{P_{i}{\lbrack k\rbrack}},{\omega_{i}{\lbrack k\rbrack}}}{c_{0}\left( {{{\overset{\sim}{P}}^{req}\lbrack k\rbrack} - {\;{P_{i}\lbrack k\rbrack}}} \right)}^{2}}\rightarrow\begin{matrix}{reference} \\{tracking}\end{matrix} \right. & \; \\\left. \begin{matrix}{battery} \\{wearing}\end{matrix}\leftarrow\left\{ \begin{matrix}{{{+ {c_{1}\left( {{\;{P_{i}\lbrack k\rbrack}} - {{\hat{P}}_{i}\lbrack k\rbrack}} \right)}^{2}}{\lambda_{i}\lbrack k\rbrack}} +} \\\left. {\mspace{11mu}\left( {1 - {\omega_{i}\lbrack k\rbrack}} \right){\omega_{i}\left\lbrack {k - 1} \right\rbrack}{\rho_{i}\lbrack k\rbrack}{{\hat{P}}_{i}^{2}\lbrack k\rbrack}} \right)\end{matrix} \right. \right. & \; \\\left. \begin{matrix}{fair} \\{allocation}\end{matrix}\leftarrow{+ \mspace{11mu}\left( {{P_{i}\lbrack k\rbrack} - {P_{i}^{ref}\lbrack k\rbrack}} \right)^{2}} \right. & (11) \\{{{s.t.\mspace{14mu} P_{i}^{\min}}{\omega_{i}\lbrack k\rbrack}} \leq {P_{i}\lbrack k\rbrack} \leq {P_{i}^{\max}{\omega_{i}\lbrack k\rbrack}}} & (12) \\{{{\omega_{i}\lbrack k\rbrack} \in \left\{ {0,1} \right\}},{\forall{i \in {\lbrack k\rbrack}}}} & (13)\end{matrix}$

-   -   wherein {tilde over (P)}^(req)[k]=P^(req)[k]−        P₁[k],    -   wherein        [k] is the collection of EVs that are locked at time k,    -   wherein λ_(i)[k]∈[0.5, 1] per EV i, quantifies how long ago and        how large power changes were, and

${\lambda_{i}\lbrack k\rbrack} = \left\{ \begin{matrix}{{{\lambda_{i}\left\lbrack k_{i}^{\prime} \right\rbrack} + {\left( \frac{{{{\overset{\hat{}}{P}}_{i}\lbrack k\rbrack} - {{\overset{\hat{}}{P}}_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}}}{P_{i}^{\max}} \right)\left( {1 - {\lambda_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}} \right)}}\ ,} \\{{{if}\mspace{14mu}{{{{\overset{\hat{}}{P}}_{i}\lbrack k\rbrack} - {P_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}}}} > {{\epsilon\mspace{14mu}{and}\mspace{14mu} k} - k_{i}^{\prime}} < T^{L}} \\{{{\left( {{\lambda_{i}\left\lbrack {k - 1} \right\rbrack} - {0.5}} \right)\delta} + {0.5}},\ {{otherwise}.}}\end{matrix} \right.$

-   -   wherein P_(i) ^(max) is a maximum power that EV i can consume        and k_(i)′ is the time of the most recent change of the setpoint        for EV i before k, so that P_(i)[κ]=P_(i)[k_(i)′] for x=

k_(i)^(′), k_(i)^(′) + 1, …  , k − 1,

-   -   and

ρ_(i)[k] = 0.5 + ζ_(i)[k]/(2    ζ_(i)[k]).

-   -   with the unit-less quantity per EV as follows

${{\zeta_{i}\lbrack k\rbrack} = {{\mathcal{s}}_{i}\frac{1}{P_{i}^{\max}}{H\left( {\frac{\Delta\;{E_{i}^{dem}\left\lbrack k_{i}^{arr} \right\rbrack}}{k_{i}^{dep} - k_{i}^{arr}},\ \frac{\Delta\;{E_{i}^{dem}\lbrack k\rbrack}}{k_{i}^{dep} - k}} \right)}}},$

-   -   wherein the H represents the harmonic mean, and by property of        the harmonic mean,

${\zeta_{i}\lbrack k\rbrack} \in \left\lbrack {0,\frac{2\; s_{i}\Delta{E_{i}^{dem}\left\lbrack k_{i}^{arr} \right\rbrack}}{P_{i}^{\max}\left( {k_{i}^{dep} - k_{i}^{arr}} \right)}} \right\rbrack$

which depend on initial state of an EV, and, moreover, ζ_(i)[k] ismonotonically increasing function of

$\frac{\Delta{E_{i}^{dem}\lbrack k\rbrack}}{k_{i}^{dep} - k},$

-   -   wherein ΔE_(i) ^(dem)[k] is the remaining energy demand of EV i        at time k and expected remaining charging k−k_(i) ^(dep),    -   wherein s_(i)>0 is the parameter that differentiates service        between classes of EVs,    -   whereby at the time k, reference powers, P_(i) ^(ref)[k]∈[0,        P_(i) ^(max)] are computed for all EVs, ideally fair such that        P_(i) ^(ref)[k]=P^(req)[k],    -   thereby minimizing an impact on battery life of EVs.

In a preferred embodiment, the method further comprises formulating amixed-integer-quadratic program based on integral terms to cope withtime-dependent variables (ρ_(i),λ_(i)) such as battery wearing, andremaining energy demand.

In a further preferred embodiment, an on/off decision for EV i at time kis denoted by ω_(i)[k], and ω_(i)[k]=1 (respectively, 0) means adecision to switch on (respectively, off) EV i at time k, and uponarrival, an EV is initially switched off, ω_(i)[k] being integervariables. The method further comprises introducing a ranking metricr_(i)[k], which combines the operational margins with μ_(i)[k]:

${r_{i}\lbrack k\rbrack} = \left\{ \begin{matrix}\frac{{\hat{P}}_{i}\lbrack k\rbrack}{P_{i}^{\max}{\mu_{i}\lbrack k\rbrack}} & {{{{if}\mspace{14mu}\Delta\;{P^{req}\lbrack k\rbrack}} < 0},} \\\frac{P_{i}^{\max} - {{\hat{P}}_{i}\lbrack k\rbrack}}{P_{i}^{\max}{\mu_{i}\lbrack k\rbrack}} & {{otherwise},}\end{matrix} \right.$

-   -   wherein ΔP^(req)[k]={tilde over (P)}^(req)[k]−        {circumflex over (P)}_(i)[k],

The method further comprises implementing a heuristic configured toreduce the number of integer variables to m, thereby reducing acomplexity of the optimisation problem and enabling the solving of theoptimisation problem in real-time,

-   -   whereby, if an amount of unlocked EVs is initially less than        m≥1, then all these unlocked EVs are enabled to change their        on/off decision, and, otherwise, determined m EVs with a largest        metric r_(i) are taken,    -   whereby a heuristic partitions the collection of unlocked EVs,        [k], into three collections: EVs that are forced to be switched        or remain on (        ^(on)[k]), EVs that are forced to be switched or remain off (        ^(off)[k]), and EVs for which the on/off decision is decided by        the optimization problem (        [k]).

In a further preferred embodiment, if {tilde over (P)}^(req)[k]∉[P^(lb),P^(ub)], the method comprises looping until fulfilling a constraint of{tilde over (P)}^(req)[k]∈[P^(lb), P^(ub)],

-   -   wherein

${P^{1b} = {\sum\limits_{x \in {\mathcal{S}^{on}{\lbrack k\rbrack}}}P_{i}^{\min}}},{P^{ub} = {\sum\limits_{i \in {{\mathcal{S}^{on}{\lbrack k\rbrack}}\bigcup{\mathcal{S}{\lbrack k\rbrack}}}}{P_{i}^{\max}.}}}$

In a further preferred embodiment, if {tilde over (P)}^(req)[k] liesabove the bounds [P^(lb), P^(ub)], the method comprises a step offorcing the EV from

[k] with highest rank to be switched on, and replacing it with highestranked EV in

=

[k]\

[k], thereby automatically increasing P^(ub), to eventually reach {tildeover (P)}^(req)[k].

In a further preferred embodiment, if {tilde over (P)}^(req)[k] liesbelow the bounds [P^(lb), P^(ub)], the method comprises a step ofswitching off the highest ranked EV from

[k], and replacing it with the highest ranked EV in

.

In contrast to prior art, the inventive method does consider the EVsheterogeneity. We do not have any information about future arrivals anddepartures, nor can we know the amount of time any charging will take.

Furthermore, we consider both switch on and off possibilities and notarbitrarily small minimum charging power.

In order to achieve all these objectives, the invention defines novelmetrics and uses them to construct a dedicated optimization problem. Asthe charging power is discontinuous (the minimum charging power is notarbitrarily small), our optimization problem is mixed integer by nature.Because the mixed-integer optimization is difficult to perform inreal-time, we propose a heuristic for reducing the number of integervariables, thus reducing the complexity of the problem.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will be better understood through the detailed descriptionof preferred embodiments, and in reference to the drawings, wherein

FIG. 1 contains a schematic view of a general setup of a chargingstation according to an example embodiment of the invention;

FIG. 2 shows a curve representative of an evolution of λ_(i)[k];

FIG. 3 illustrates a result of water-filling algorithm for 5 EVs,wherein EVs 1, 4 and 5 are fully filled, whereas 2 and 3 have referencepowers of hζ₂ and hζ₃ respectively;

FIG. 4 shows a schematic representation of a structure of a grid, thearrows showing positive directions of corresponding active-power flows;and

FIG. 5 describes an example heuristic in from of detailed Algorithm 1.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

In order to achieve all the objectives that the invention aims to, wedefine novel metrics and use them to construct a dedicated optimizationproblem. As the charging power is discontinuous (the minimum chargingpower is not arbitrarily small), our optimization problem is mixedinteger by nature. Because the mixed-integer optimization is difficultto perform in real-time, we propose a heuristic for reducing the numberof integer variables, thus reducing the complexity of the problem.

In the following sections of the present application, we will describe

-   -   the charging control problem;    -   details of the developed control strategy; and    -   provision of numerical examples with performance metrics to        validate the inventive method.

In general, the approach taken in the context of the invention

-   -   assumes that the control scheme has no internal information        about battery charging (e.g., ramping rates, current        State-of-Energy), which is more realistic, as modern charging        stations are myopic to these kinds of parameters;    -   concerns a method that provides sub-second-scale control.        Whereas most of the existing methods work on minute scale, ours        enables the CS to react faster to changes in the grid;    -   makes use of a realistic model for the batteries charging-power,        i.e., an EV is either switched off (charging power is 0 W), or        its power lies within non-zero bounds;    -   minimizes the battery wearing by avoiding large power jumps and        reducing the number of cycles;    -   assumes that the departure time of an EV is only an estimation,        hence we assume that the precise departure time is unknown.

Problem Statement Charging-Station Model

We consider a charging station (CS) that can host N EVs. Time isdiscretized in constant interval, indexed by k. The CS keeps track ofthe number of connected EVs at every step k. A newly arrived EV cannotbegin charging before being instructed by the CS. Each EV, say i, uponits arrival, is assumed to inform the CS: (i) charging-power boundsP_(i) ^(min) and P_(i) ^(max), (ii) energy demand at arrival E_(i)^(dem), and (iii) expected departure time t_(i) ^(dep). Informationabout future arrivals, future expected departures and future demands isunknown. Also, the CS has access to the measured power {circumflex over(P)}_(i)[k] of EV i at every time k. The CS is able to control thecharging power of an EV by sending the setpoint P_(i)[k] to EV i at timek (see FIG. 1). FIG. 1 illustrates a schematic view of a general setupof a charging station according to an example embodiment of theinvention. The general setup comprises the charging station to which atleast one electrical vehicle is/are connected. The controlling from thecharging station of the charging power of any one of the EVs is done bysending respectively setpoint P₁[k], P₂[k], . . . P_(N)[k] as shown bymeans of the dotted arrows directed to vehicles, and receiving in returncorresponding readings {circumflex over (P)}₁[k], {circumflex over(P)}₂[k], . . . {circumflex over (P)}_(N)[k]. After informing the gridcontroller about the readings, the charging station receives from thegrid controller in real time an aggregated power-setpoint P^(req)[k],and sends back to the grid controller a flexibility parameter.

The CS receives aggregated setpoints, P^(req)[k], from the gridcontroller. In return, it sends its updated status that includes itsflexibility.

Constraints of the EVs

We assume that the CS has the ability to stop the charge of an EV. Then,the individual power flexibility of EV i is defined by the set{0}∪[P_(i) ^(min); P_(i) ^(max)]. However, EVs cannot immediately changetheir charging power due to delays:

-   -   reaction delay is the time an EV takes to start modifying its        power after receiving a new setpoint,    -   implementation delay is the time an EV takes to reach a new        setpoint, which depends on the EV charger ramping-rate.

We say that an EV is locked if it is in the process of reacting orimplementing a setpoint. As the specific delays are usually differentfor every type of EV, it is difficult to know their exact values.Therefore, we take a conservative upper bound T^(L) (20 s in thispaper). Namely, we consider that, after receiving a setpoint, any EVwill be locked for a locking period T^(L).

Note that, the locking of the EVs temporarily shrinks the flexibility ofthe CS, since the amount of EVs that can change power varies from onecontrol cycle to another. Moreover, as the ramping rates and delays areunknown, it is impossible to know exactly how the charging power willchange when an EV is locked. This information is supposed to beconstantly sent to the grid controller.

Power Allocation of EVs

The CS needs to allocate the time-varying aggregated power-setpoint tothe connected EVs. The purpose of the power-allocation strategy is toallocate the consumed power in such a way that the EV demands aresatisfied and their batteries are protected. In particular, fastvariations of the aggregated setpoint should be smoothed, otherwise itsdirect implementation can degrade the EV batteries. Summarizing, theobjectives of the allocation strategy are:

-   -   1) track the external request from a grid operator,    -   2) minimize the wearing of EV batteries,    -   3) maximize the EVs energy-demand satisfaction fairly,    -   4) minimize the number of times the charging station stops the        charging of an EV, while it is plugged-in.

The present invention considers all four objectives together. In thenext section we formulate a specific mixed-integer program and show howwe solve it in real-time.

Control Scheme

The control scheme computes setpoints for all EVs that are not locked attime k. Let us introduce some notations that will help us formulatingthe optimization problem.

-   -   [k] is the collection of EVs that are unlocked at time k, just        before starting a new computation of setpoints.    -   [k] is the collection of EVs that are locked at time k.    -   [k] is the collection of setpoints that will be computed for        each EV in        [k].

As introduced previously herein above, an EV i can receive setpoints inthe set {0}∪[P_(i) ^(min); P_(i) ^(max)]. We denote the on/off decisionfor EV i at time k by ω_(i)[k]. Specifically, ω_(i)[k]=1 (respectively,0) means that we decide to switch on (respectively, off) EV i at time k.Upon arrival, we assume that an EV is initially switched off. Then, letΩ[k] be the collection of on/off decisions that will be computed foreach EV in

[k]. Our task is to find the collection of setpoints

[k] and decisions Ω[k], while minimizing the objectives described inSection II. To this end we introduce the following objective function

$\begin{matrix}{{{c_{0}{f_{0}\left( {\lbrack k\rbrack} \right)}} + {c_{1}\left( {{f_{1}\left( {\lbrack k\rbrack} \right)} + {f_{2}\left( {\Omega\lbrack k\rbrack} \right)}} \right)} + {f_{3}\left( {\lbrack k\rbrack} \right)}},} & (1)\end{matrix}$

where f₀, f₁, f₂, f₃ are quadratic functions, and parameters c₀, c₁>0which will be described in next subsections. Note that, this controlscheme is a mixed-integer problem due to the presence of the collectionof binary control variables Ω[k].

Aggregated Power-Setpoint Tracking

The first term in (1) is responsible for tracking the aggregatedpower-setpoint P^(req)[k]. As, in general, some EVs are locked, our goalis to track the aggregated setpoint by changing the power of theunlocked EVs in

[k], while taking into account the locked EVs in

[k]. As the locked EVs are either reacting to or implementing a previoussetpoint, they should be removed from the aggregated setpoint, i.e.{tilde over (P)}^(req)[k]=P^(req)[k]−

P_(i)[k]. In this case, P_(i)[k] represents the very last setpoint thata locked EV has received. This impedes the CS to reallocate the samepower in the unlocked EVs. Finally, f₀ can be expressed as

$\begin{matrix}{{f_{0}\left( {\lbrack k\rbrack} \right)} = \left( {{{\overset{\sim}{P}}^{req}\lbrack k\rbrack} - {\mspace{11mu}{P_{i}\lbrack k\rbrack}}} \right)^{2}} & (2)\end{matrix}$

Battery Wearing

In order to minimize the impact of changing power in the EV batteries,we use f₁ and f₂ in the objective function. f₁ penalizes the deviationbetween the setpoint and the measured power, together with the changesin the measured power. f₂ penalizes sudden switch off of the EVs causedby the CS. To formalize f₁ and f₂, let us introduce new variables. Asour method is online, we introduce two non-linear integral terms toaccount for (i) the past behaviour of EVs charging power, and (ii) thedesire of an EV to be charged.

The first of these terms, λ_(i)[k]∈[0.5, 1] per EV i, quantifies howlong ago and how large power changes were. This is used as a prioritymetric: the smaller λ_(i), the more priority to change power. Let k_(i)′be the time of the most recent change of the setpoint for EV i before k(so that P_(i)[κ]=P_(i)[k_(i)′] for x=k_(i)′, k_(i)′+1, . . . , k−1).Note that, k_(i)′ is function of k as well but, for the ease ofnotation, we drop this dependency. When EV i arrives, P_(i)[k_(i)′] isset to zero. Consequently, we take

$\begin{matrix}{{\lambda_{i}\lbrack k\rbrack} = \left\{ \begin{matrix}{{{\lambda_{i}\left\lbrack k_{i}^{\prime} \right\rbrack} + {\left( \frac{{{{\overset{\hat{}}{P}}_{i}\lbrack k\rbrack} - {{\overset{\hat{}}{P}}_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}}}{P_{i}^{\max}} \right)\left( {1 - {\lambda_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}} \right)}}\ ,} \\{{{if}\mspace{14mu}{{{{\overset{\hat{}}{P}}_{i}\lbrack k\rbrack} - {P_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}}}} > {{\epsilon\mspace{14mu}{and}\mspace{14mu} k} - k_{i}^{\prime}} < T^{L}} \\{{{\left( {{\lambda_{i}\left\lbrack {k - 1} \right\rbrack} - {0.5}} \right)\delta} + {0.5}},\ {{otherwise}.}}\end{matrix} \right.} & (3)\end{matrix}$

We now refer to FIG. 2 which shows a curve representative of anevolution of λ_(i)[k] in the lower part of the page, and in the upperhalf of the page, with same position of the k-axis, a curve of anevolution of setpoint P_(i)[k]. Different zones separated by dottedlines represent cases where the EV is unlocked or locked. The first caseof Eq. (3) occurs when EV i is locked and the setpoint is not yetimplemented. In this case, λ_(i)[k] increases linearly with respect tothe implemented power change (grey area on FIG. 2). It is defined by thefollowing conditions, first case (i) and second case (ii):

$\begin{matrix}{{{{if}\mspace{14mu}{{\overset{\hat{}}{P}}_{i}\lbrack k\rbrack}} = {{\overset{\hat{}}{P}}_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}},{{{then}\mspace{14mu}{\lambda_{i}\lbrack k\rbrack}} = {\lambda_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}},{and}} & (i) \\{{{{if}\mspace{14mu}{{{{\overset{\hat{}}{P}}_{i}\lbrack k\rbrack} - {{\overset{\hat{}}{P}}_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}}}} = P_{i}^{\max}},{{\lambda_{i}\lbrack k\rbrack} = 1.}} & ({ii})\end{matrix}$

In the second case, λ_(i)[k] i decreases exponentially with a decay δ(see FIG. 2). Observe that the right-hand side of Eq. (3) is always in[0.5, 1]. f₁ uses the term P_(i)[k]−{circumflex over (P)}_(i)[k] and f₁(

[k]) as follows

$\begin{matrix}{{f_{1}\left( {\lbrack k\rbrack} \right)} = {\left( {{P_{i}\lbrack k\rbrack} - {{\hat{P}}_{i}\lbrack k\rbrack}} \right)^{2}{{\lambda_{i}\lbrack k\rbrack}.}}} & (4)\end{matrix}$

The second term, ρ_(i)[k]∈[0.5, 1], expresses the desire of an EV i tocharge. It is also used as a priority metric: the larger the ρ_(i) themore priority to increase the power. Note that, the CS can keep track ofthe remaining energy demand ΔE_(i) ^(dem)[k] of EV i at time k, andexpected remaining charging k−k_(i) ^(dep). Therefore at time k, the CScomputes the power that EV i needs to satisfy its demand as

$\frac{\Delta\;{E_{i}^{dem}\lbrack k\rbrack}}{k_{i}^{dep} - k}.$

Additionally for k=k_(i) ^(arr) this power equals to

$\frac{\Delta\;{E_{i}^{dem}\left\lbrack k_{i}^{arr} \right\rbrack}}{k_{i}^{dep} - k_{i}^{arr}}.$

With this, we compute the unit-less quantity per EV as follows

$\begin{matrix}{{{\zeta_{i}\lbrack k\rbrack} = {s_{i}\frac{1}{P_{i}^{\max}}{H\left( {\frac{\Delta\;{E_{i}^{dem}\left\lbrack k_{i}^{arr} \right\rbrack}}{k_{i}^{dep} - k_{i}^{arr}},\ \frac{\Delta\;{E_{i}^{dem}\lbrack k\rbrack}}{k_{i}^{dep} - k}} \right)}}},} & (5)\end{matrix}$

where H represents the harmonic mean and s_(i)>0 is the parameter thatdifferentiates service between classes of EVs. By property of theharmonic mean,

${\zeta_{i}\lbrack k\rbrack} \in \left\lbrack {0,\frac{2s_{i}\Delta{E_{i}^{dem}\left\lbrack k_{i}^{arr} \right\rbrack}}{P_{i}^{\max}\left( {k_{i}^{dep} - k_{i}^{arr}} \right)}} \right\rbrack$

which depend on initial state of an EV. Moreover, ζ_(i)[k] ismonotonically increasing function of

$\frac{\Delta{E_{i}^{dem}\lbrack k\rbrack}}{k_{i}^{dep} - k}.$

Consequently, we take

$\begin{matrix}{{\rho_{i}\lbrack k\rbrack} = {{0.5} + {{\zeta_{i}\lbrack k\rbrack}/{\left( {2\mspace{11mu}\mspace{11mu}{\zeta_{i}\lbrack k\rbrack}} \right).}}}} & (6)\end{matrix}$

f₂, which penalizes the switch off of EVs, is expressed as

$\begin{matrix}{{f_{2}\left( {\Omega\lbrack k\rbrack} \right)} = {\mspace{11mu}\left( {1 - {\omega_{i}\lbrack k\rbrack}} \right){\omega_{i}\left\lbrack {k - 1} \right\rbrack}{\rho_{i}\lbrack k\rbrack}{{{\hat{P}}_{i}^{2}\lbrack k\rbrack}.}}} & (7)\end{matrix}$

We multiply each term by ρ_(i)[k] to enforce EVs with larger values tobe switched off at last. We also multiply by ω_(i)[k−1] to exclude EVsthat are switched off.

Fair Allocation of Charging Power

One of the aims of the invention is that the aggregated power that mustbe allocated among EVs is driven by P^(req). In order to anticipate thefuture information, we allocate the power by using ζ_(i) as a weight forEV i. To this end, at time k, we compute reference powers, P_(i)^(ref)[k]∈[0, P_(i) ^(max)] for all EVs, ideally fair such that

P_(i) ^(ref)[k]=P^(req)[k]. Commonly used fair allocations areweighted-proportional and weighted-max-min [22]

Let us first describe the weighted-max-min fair allocation. As the setof constraints is convex and compact (i.e., closed and bounded inEuclidean space), we know that this allocation exists and is unique[22]. In order to find such an allocation, the water-filling algorithmis used, which works as follows. The power of all EVs is increased atthe same pace, until one or more powers reach their maximum. The powersthat reach their maximum are frozen, and the others continue to increaseat the same pace. The algorithm is repeated until

P_(i) ^(ref)=P^(req) (from here on, the time index k is omitted forsimplicity of notation). For details, see FIG. 3. Here, we use againζ_(i) to prioritize the EVs that need to be charged to satisfy theirdemand. Each EV i is represented as a water tank of width ζ_(i) andheight

$\frac{P_{i}^{\max}}{\zeta_{i}}.$

The volume of water in the tank is either P_(i) ^(max) or hζ_(i), whereh is the common height of the non-saturated tanks. The result of thewater-filling algorithm is illustrated for 5 EVs. EVs 1, 4 and 5 arefully filled, so their reference powers are P₁ ^(max), P₄ ^(max) and P₅^(max) respectively, whereas 2 and 3 have reference powers of hζ₂ andhζ₃ respectively.

Another possibility is to consider weighted-proportional fairness. Wefind a proportionally fair allocation of power by solving the followingconvex optimization-problem in (A):

$\begin{matrix}{(A)} & \; \\{\max\limits_{\underset{i}{pref}}{\zeta_{i}\log\; P_{i}^{ref}}} & \; \\{{s.t.\mspace{14mu} 0} < P_{i}^{ref} \leq P_{i}^{\max}} & (8) \\{{\; P_{i}^{ref}} = P^{req}} & (9)\end{matrix}$

Full Formulation

By combining (1), (2), (4), (7), (10) with constraints, the optimisationproblem to be solved, at each time k, is:

$\begin{matrix}{(P)\mspace{709mu}} & \; \\\left. {\min\limits_{{P_{i}{\lbrack k\rbrack}},{\omega_{i}{\lbrack k\rbrack}}}{c_{0}\left( {{{\overset{\sim}{P}}^{req}\lbrack k\rbrack} - {P_{i}\lbrack k\rbrack}} \right)}^{2}}\rightarrow\begin{matrix}{reference} \\{tracking}\end{matrix} \right. & \; \\\left. \begin{matrix}{battery} \\{wearing}\end{matrix}\leftarrow\left\{ \begin{matrix}{+ {c_{1}\left( {{\left( {{P_{i}\lbrack k\rbrack} - {{\hat{P}}_{i}\lbrack k\rbrack}} \right)^{2}{\lambda_{i}\lbrack k\rbrack}} +} \right.}} \\\left. {\left( {1 - {\omega_{i}\lbrack k\rbrack}} \right){\omega_{i}\left\lbrack {k - 1} \right\rbrack}{\rho_{i}\lbrack k\rbrack}{{\hat{P}}_{i}^{2}\lbrack k\rbrack}} \right)\end{matrix} \right. \right. & \; \\\left. \begin{matrix}{fair} \\{allocation}\end{matrix}\leftarrow{+ \left( {{P_{i}\lbrack k\rbrack} - {P_{i}^{ref}\lbrack k\rbrack}} \right)^{2}} \right. & (11) \\{{{s.t.\mspace{14mu} P_{i}^{\min}}{\omega_{i}\lbrack k\rbrack}} \leq {P_{i}\lbrack k\rbrack} \leq {P_{i}^{\max}{\omega_{i}\lbrack k\rbrack}}} & (12) \\{{{\omega_{i}\lbrack k\rbrack} \in \left\{ {0,1} \right\}},{\forall{i \in {\lbrack k\rbrack}}}} & (13)\end{matrix}$

Real-Time Implementation Aspects Reducing the Number of IntegerVariables

Since (P) is mixed integer, its complexity grows exponentially with thenumber of integer variables [23] (here ω_(i)). To reduce the problemcomplexity, we propose a heuristic, that runs every time k, which limitsthe number of integer variables. The heuristic partitions the collectionof unlocked EVs,

[k], into three collections: EVs that are forced to be switched (orremain) on (

^(on)[k]), EVs that are forced to be switched (or remain) off (

^(off)[k]), and EVs for which the on/off decision is decided by theoptimization problem (

[k]). We require that |

[k]|≤m, where m is fixed small number.

In other words, we define a new problem (H) that at most m integervariables. All other ω_(i)[k] remain fixed.

( H ) ⁢ min P i ⁡ [ k ] , ω i ⁡ [ k ] ( 11 ) s . t . ( 12 , 13 ) ω i ⁡ [ k ]= 1 , ∀ i ∈ 𝒮 on ⁡ [ k ] , ω j ⁡ [ k ] = 0 , ∀ j ∈ off ⁡ [ k ] ( 14 )

The constraints in (14) force the EVs to be switched on/off.

Note that, with this consideration, the flexibility that the problem (H)considers is, however, smaller than that of (P). Namely, the power to beallocated among the unlocked EVs, {tilde over (P)}^(req)[k], may not beable to be tracked, depending on the partition of

. Let us thus define the full flexibility of the CS at time k, as

(see Section V-B), and the reduced flexibility (the one available for(H)), as the interval [P^(lb), P^(ub)] with

$\begin{matrix}{{P^{1\; b} = {P_{i}^{\min}}},{P^{ub} = {P_{i}^{\max}.}}} & (15)\end{matrix}$

Thus, the partition {

[k],

^(on)[k],

^(off)[k]} should ensure that {tilde over (P)}^(req) ∈[P^(lb), P^(ub)].Note that, we compute the bounds excluding locked EVs. Their power isalready defined as explained in Section III-C.

We now describe the heuristic, detailed in Algorithm 1, reproduced inFIG. 5. First, we define a metric that takes into account both the pastbehaviour of the EVs power and their desire to be charged, as follows:

$\begin{matrix}{{{\mu_{i}\lbrack k\rbrack} = {{\lambda_{i}\lbrack k\rbrack} + {\left( {1 - {\omega_{i}\left\lbrack {k - 1} \right\rbrack}} \right)\left( {1.5 - {\rho_{i}\lbrack k\rbrack}} \right)} + {{\omega_{i}\left\lbrack {k - 1} \right\rbrack}{\rho_{i}\lbrack k\rbrack}}}},} & (16)\end{matrix}$

with μ_(i)[k]∈[1, 2], unit-less, and consisting of three parts:

-   -   λ_(i)[k] contains information about the past behaviour of the        charging power. Smaller λ_(i)[k] means that EV i is more        propense to change its power,    -   (1−ω_(i)[k−1])(1.5−ρ_(i)[k]) identifies the propensity of a        switched-off EV to switch on,    -   ω_(i)[k−1]ρ_(i)[k] identifies the propensity of a switched-on EV        to switch off.

Therefore, μ_(i)[k] quantifies the propensity of EV i to change itson/off decision and charging power. Smaller μ_(i)[k] indicates morepropensity.

Second, we rank the EVs according to their individual operationalmargins. Since the maximum power of EV i can consume is P_(i) ^(max) andthe minimum is 0, its positive margin P_(i) ^(max)−{circumflex over(P)}_(i)[k] and its negative margin is {circumflex over (P)}_(i)[k].Dividing these values by P_(i) ^(max) we get normalized margins. Wehence introduce the ranking metric r_(i)[k], which combines theoperational margins with μ_(i)[k]:

$\begin{matrix}{{r_{i}\lbrack k\rbrack} = \left\{ \begin{matrix}\frac{{\hat{P}}_{i}\lbrack k\rbrack}{P_{i}^{\max}{\mu_{i}\lbrack k\rbrack}} & {{{{if}\mspace{14mu}\Delta\;{P^{req}\lbrack k\rbrack}} < 0},} \\\frac{P_{i}^{\max} - {{\hat{P}}_{i}\lbrack k\rbrack}}{P_{i}^{\max}{\mu_{i}\lbrack k\rbrack}} & {{otherwise},}\end{matrix} \right.} & (17)\end{matrix}$

where ΔP^(req)[k]={tilde over (P)}^(req)[k]−

{circumflex over (P)}_(i)[k]. Finally, we define the function (top(

, m) that returns the index of the m elements with the largest r_(i)[k]metric, from a collection

. In rest of this section, we omit the time index k for sake of clarity.

The goal of the heuristic is to limit the number of integer variables tom. If the amount of unlocked EVs is initially less than m, then allthese EVs can change their on/off decision (lines 2-3). Otherwise, wetake the m EVs with the largest metric r_(i) (lines 5-8). This choice issufficient in most of the cases since, according to r_(i), these EVs arethe best to be selected. However, it can happen that {tilde over(P)}^(req)[k]∉[P^(lb), P^(ub)], in which case we loop until fulfillingthis constraint. If {tilde over (P)}^(req) lies above the bounds, weforce the EV from

with highest rank to be switched on, and replace it with highest rankedEV in

=

(lines 12-14, 18-19). Doing this, we automatically increase P^(ub),eventually reaching {tilde over (P)}^(reg) (see Theorem 2 herein below).Similarly, if {tilde over (P)}^(req) lies below the bounds, we switchoff the highest ranked EV from

(lines 15-17) and replace it with the highest ranked EV in

.

Theorem 2, which expresses a correctness of the heuristics, is asfollows:

given that m≥1, Alg. 1 finds the partition

of

, such that {tilde over (P)}^(req)∈[P^(lb), P^(ub)], |S|≤m. Alg. 1 takesat most |

|−m iterations.

Validation

For a validation of the method according to the invention, we consider agrid with an existing 500 kWp PV plant connected to the distributionnetwork through a power transformer rated S_(Tr) ^(r)=500 kVA (note thatwe do not consider grid constraints other than the transformer ratedpower). We claim that, in such setup, we can install a charging station(CS) of P_(CS) ^(r)=1000 kW power rating. Referring to FIG. 4, thisillustrates an example structure of the grid, in which the arrows showthe positive directions of the corresponding active-power flows. AlsoFIG. 4 provides proof of S4. (a) {tilde over (P)}_(req)<

(visiting line 14), then it is impossible that

<{tilde over (P)}_(req)<

. (b) Similarly, if {tilde over (P)}_(req)>

(visiting line 16), it is impossible that

<{tilde over (P)}_(req)<

. Moreover, we consider that the CS is composed by 60 slots of 22 kWmax. This is a stress test for our method since we will force the CS toopportunistically use the maximum available power.

To simulate the PV production, we use irradiance measurements taken inthe Authors laboratory, which are then scaled according to the PV ratedpower. We simulate the arrival of EVs to the CS as a homogeneous Poissonprocess with rate 30 arrivals/hour. We assume that, upon arrival (atk_(i) ^(arr)), EV i informs its energy-demand E_(i) and the expecteddeparture-time k_(i) ^(dep). We model the staying time (k_(i)^(dep)−k_(i) ^(arr)) to be uniformly distributed between 1.5 and 1.6hours. Furthermore, we consider that a user will not necessarily leaveat precisely the informed time. The real staying-time is also modelledwith the same distribution. An EV will leave after the real staying-timeregardless of its level of charge. Given the distributions of thearrival time and the staying time, it is highly likely that an EV willfind an available slot upon arrival, otherwise this EV is ignored (sincein practice this EV will leave for another charging station). In all oursimulation scenarios, this property was maintained. We consider twogroups of EVs: group A with high and group B with low energy-demand. Thedemand is uniformly distributed between 28 and 32 kWh and between 3 and5 kWh respectively. Considered reaction times are also uniformlydistributed between 2 and 3 s and the ramping rate is 5 kW/s (this ratewas taken according to the maximum charging power, such that the EV willreach its maximum power before locking period finishes). The minimum andmaximum powers of the modelled EVs are 2 kW and 22 kW.

We consider 3 scenarios, mainly defined by the PV trace, that arerepresentative enough to show all our method features:

-   -   regular production, when the PV production is smooth,    -   sharp jump, when, for emergency reasons, part of the PV plant is        suddenly disconnected, and    -   fluctuating production, when the PV production is characterized        by large fluctuations.

We also analyze the influence of different combinations of weightsc_(o), c₁ on the performance of our method.

Model of the Grid Controller

We next describe the way we model the decision of the grid controller.We assume that all resources are connected to the same node, thussimplifying the power-balance equation to P_(Tr)=P_(CS)−P_(PV), beingP_(Tr) the transformer, P_(PV) the PV plant and P_(CS) the chargingstation powers respectively. The control variable is P_(CS), while thecontrolled variable is P_(Tr). The goal of this controller is tomaximize PCS, while trying to avoid the violation of the transformerrated power, i.e., |P_(Tr)|≤S_(Tr) ^(r), subject to the uncertaintyproduced by (i) the variation of the injected PV power and (ii) thecharging of locked EVs. We focus on the case when the violation isproduced by an overconsumption of the CS. The case when the violation isproduced by an overproduction of the PV plant can be handled similarly.Hence, the controller decision is computed as

$\begin{matrix}{{P^{req} = {P_{Tr}^{r} + P_{PV}^{\downarrow} - {\Delta P_{CS}^{\uparrow}}}},} & (18)\end{matrix}$

where P_(PV) ^(↓) is the one-step-ahead minimum expected PV production,computed by a short-term forecasting tool [10]. ΔP_(CS) ^(↑) is themaximum possible consumption increment of locked EVs, i.e., thedifference between their individual setpoint and their current measuredpower

$\begin{matrix}{{{\Delta P_{CS}^{\uparrow}} = {{\sum\limits_{i \in {\mathcal{L} \uparrow}}P_{i}} - {\hat{P}}_{i}}},{\mathcal{L}^{\uparrow} = {\left\{ {i \in \mathcal{L}} \middle| {{P_{i} - {\hat{P}}_{i}} \geq 0} \right\}.}}} & (19)\end{matrix}$

This term accounts for the uncertainty of EVs at implementing a setpointdue to the unknown ramping properties of each EV. Finally, the computedsetpoint is saturated depending on the current flexibility of the CS,computed by the CS itself and sent to the grid controller, representedby the interval

$\begin{matrix}{= {\left\lbrack {{\sum\limits_{i \in \mathcal{L}}P_{i}},\ {\min\left( {{{\sum\limits_{i \in \mathcal{L}}P_{i}} + {\sum\limits_{i \in \mathcal{C}}P_{i}^{\max}}},\ P_{CS}^{r}} \right)}} \right\rbrack.}} & (20)\end{matrix}$

It is worth noting that the flexibility is lower bounded by the lockedEVs and upper bounded by the maximum power of the unlocked EVs. Theflexibility is not limited by the minimum power and the handling of anysetpoint below

$\min\limits_{i}P_{i}^{\min}$

is ensured ay Algorithm 1. Besides, the controller cannot ensure toavoid the violation transformer rated-power violation due to the rampingmechanism of the locked EVs, but, in the worst-case scenario, it willtake a time T^(L) (locking period) to regain more flexibility, thusdecreasing the consumption.

Performance Evaluation Metrics

As our optimization problem in (H) is multi-objective, we define thefollowing metrics for the performance evaluation:

-   -   follow-request—measures how well a CS follows the aggregated        setpoint

$\begin{matrix}{M^{fr} = {\frac{1}{K}{\sum\limits_{k = 1}^{K}{❘{{P^{req}\lbrack k\rbrack} - {\hat{P}\lbrack k\rbrack}}❘}}}} & (21)\end{matrix}$

where K is the amount of discrete time-steps during the selected controlperiod and {circumflex over (P)}[k]=

{circumflex over (P)}_(i)[k]. This metric is lower bounded by 0. Then,the close M^(fr) is to 0, the better the CS follows the aggregatedsetpoint.

-   -   non-satisfied demand—measures how well the charging demand of EV        i is satisfied

$\begin{matrix}{M_{i}^{nsd} = {\Delta\;{{E_{i}\left\lbrack k_{i}^{stop} \right\rbrack}/\Delta}\;{E_{i}\left\lbrack k_{i}^{arr} \right\rbrack}}} & (22)\end{matrix}$

where ΔE_(i)[k_(i) ^(stop)] is the energy that remains to be satisfiedat departure time, and ΔE_(i)[k_(i) ^(arr)] is the initial energydemand. M_(i) ^(nsd)∈[0, 1].

-   -   battery-wearing measures—the changes of the charging power

$\begin{matrix}{M_{i}^{bw} = {\frac{1}{2\left( P_{i}^{\max} \right)^{2}}{\sum\limits_{k = 1}^{K}\left( {{P_{i}\lbrack k\rbrack} - {P_{i}\left\lbrack {k - 1} \right\rbrack}} \right)^{2}}}} & (23)\end{matrix}$

This metric shows the impact of the control scheme into the batterylife. The closer M_(i) ^(bw) to 0, the less impact.

-   -   violation—measures the violation of the transformer capacity        limit

M viol = ( ∑ k = 1 K ( P ^ [ k ] - P Tr r - P PV [ k ] ) ( P ^ [ k ] - PPV [ k ] ) ≥ P Tr r ) / P Tr r ( 24 )

The metric is lower bounded by 0, meaning that no violation of thetransformer limit occurred.

Simulation Findings

Our finding is that for all scenarios, the combination of weights c₀=1,c₁=10 dominates among others.

CONCLUSION

The invention proposes a control scheme for controlling the charging ofelectric vehicles connected to a single charging station, whilefollowing an aggregated power-setpoint in real time. When tracking thepower setpoint, the overall consumed power is allocated fairly among theconnected EV, minimizing the impact on the battery life. Specifically,we formulate a mixed-integer-quadratic program based on novel integralterms to cope with time-dependent variables such as battery wearing andremaining energy-demand. In addition, the invention proposes a heuristicthat reduces the number of integer variables in order to reduce theproblem complexity, allowing it to be solved in real time.

REFERENCES

-   [1]D. Block, J. Harrison, and P. Brooker, “Electric Vehicle Sales    for 2014 and Future Projections,” Florida Solar Energy Center, March    2015.-   [2]K. Clement, E. J. Haesen, and J. Driesen, “Coordinated charging    of multiple plug-in hybrid electric vehicles in residential    distribution grids,” Proc. Power Syst. Conf. Expo., pp. 1-7, 2009.-   [3]J. A. P. Lopes, F. J. Soares, and P. M. R. Almeida, “Integration    of electric vehicles in the electric power system,” proc. IEEE, vol.    99, no. 1, pp. 168-183, January 2011.-   [4]G. A. Putrus, P. Suwanapingkarl, D. Johnston, E. C. Bentley,    and M. Narayana, “Impact of electric vehicles on power distribution    net-works,” IEEE Vehicle Power and Propulsion Conference, September    2009.-   [5]P. B. Evans, S. Kuloor, and B. Kroposki, “Impacts of plug-in    vehicles and distributed storage on electric power delivery    networks,” IEEE Vehicle Power and Propulsion Conference, September    2009.-   [6]C. Dharmakeerthi, N. Mithulananthan, and T. Saha, “Impact of    electric vehicle fast charging on power system voltage stability,”    Electrical Power and Energy Systems, vol. 57, pp. 241-249, 2014.-   [7]J. Pillai and B. Bak-Jensen, “Impacts of electric vehicle loads    on power distribution systems,” IEEE Vehicle Power and Propulsion    Conf., 2010.-   [8]L. Fernandez,′ T. San Roman, R. Cossent, C. Domingo, and P.    Frias, “Assessment of the impact of plug-in electric vehicles on    distribution networks,” IEEE Trans. on Power Sys., vol. 26, no. 1,    pp. 206-213, 2011.-   [9]S. Acha, T. Green, and N. Shah, “Effects of optimised plug-in    hybrid vehicle charging strategies on electric distribution network    losses,” IEEE PES T&D 2010, April 2010.-   [10] E. Scolari, D. Torregrossa, J.-Y. Le Boudec, and M. Paolone,    “Ultra-short-term prediction intervals of photovoltaic AC active    power,” Inter-national Conf. on Prob. Methods Applied to Power    Systems, October 2016.-   [11] A. Bernstein, L. Reyes-Chamorro, J.-Y. Le Boudec, and M.    Paolone, “A composable method for real-time control of active    distribution networks with explicit power set points. Part I:    Framework,” Electric Power Systems Research, vol. 6, no. August, pp.    254-264, 2015.-   [12] E. Sotromme and M. A. El-Sharkawi, “Optimal scheduling of    vehicle-to-grid energy and ancillary services,” IEEE Transactions on    Smart Grid, vol. 3, no. 1, pp. 351-359, March 2012.-   [13] M. Liu, P. McNamara, and S. McLoone, “Fair charging strategies    for EVs connected to a low-voltage distribution network,” IEEE PES    ISGT Europe, 2013.-   [14] S. Xie, W. Zhong, K. Xie, R. Yu, and Y. Zhang, “Fair energy    scheduling for vehicle-to-grid networks using adaptive dynamic    programming,” IEEE Trans. on Neural Networks and Learning Systems,    vol. 27, no. 8, pp. 1697-1707, 2016.-   [15] S. Vandael, B. Claessens, M. Hommelberg, T. Holvoet, and G.    Decon-inck, “A scalable three-step approach for demand side    management of plug-in hybrid vehicles,” IEEE Trans. on Smart Grid,    vol. 4, no. 2, pp. 720-728, 2013.-   [16] S. Deilami, A. Masoum, P. Moses, and M. A. S. Masoum,    “Real-time coordination of plug-in electric vehicle charging in    smart grids to minimize power losses and improve voltage profile,”    IEEE Trans. on Smart Grid, vol. 2, no. 3, pp. 456-467, 2011.-   [17] Z. Ma, D. Callaway, and I. Hiskens, “Decentralized charging    control of large populations of plug-in electric vehicles,” IEEE    Trans. on Control Sys. Tech., vol. 21, no. 1, pp. 67-78, 2013.-   [18] Y. He, B. Venkatesh, and L. Guan, “Optimal scheduling for    charging and discharging of electric vehicles,” IEEE Trans. on Smart    Grid, vol. 3, no. 3, pp. 1095-1105, 2012.-   [19] L. Gan, U. Topcu, and S. Low, “Optimal decentralized protocol    for electric vehicle charging,” IEEE Trans. on Power Systems, vol.    28, no. 2, pp. 940-951, 2013.-   [20] Y. Mou, H. Xing, Z. Lin, and M. Fu, “Decentralized optimal    demand-side management for phev charging in a smart grid,” IEEE    Trans. on Smart Grid, vol. 6, no. 2, pp. 726-736, 2015.-   [21] M. Liu, S. McLoone, S. Studli, R. Middleton, R. Shorten, and J.    Braslays, “On-off based charging strategies for EVs connected to a    low voltage distribution network,” IEEE PES APPEEC, 2013.-   [22] B. Radunovic and J.-Y. Le Boudec, “A unified framework for    max-min and min-max fairness with applications,” IEEE/ACM Trans. on    Net., vol. 15, no. October, pp. 1073-1083, 2007.-   [23] F. S. Hillier and G. J. Lieberman, Introduction to Operations    Research. McGraw-Hill, 2010

1. A method for controlling the charging of at least an electricalvehicles (EVs) connected to a single charging station (CS), whereby theat least one electrical vehicle may be either locked or unlocked, an EVbeing locked if it is in the process of reacting or implementing asetpoint, the method comprising continuously tracking at the chargingstation of a number of the at least one electric vehicle connected;controlling from the charging station a charging power of each EV bysending a setpoint P_(i)[k] to an EV i at time k; receiving at thecharging station a measured power {circumflex over (P)}_(i)[k] from eachEV i at time k, computing at a grid controller for all EVs that are notlocked at the time k, an aggregated power-setpoint P^(req)[k] in realtime; receiving at the charging station the aggregated power-setpointP^(req)[k] at any time k; sending from the charging station to the gridcontroller a charging station power flexibility interval, the latterbeing a power range which the charging station is configured toimplement; allocating an overall consumed power fairly among theconnected EVs by solving the following optimisation problem:$\begin{matrix}{\left. {(P)\min\limits_{{P_{i}\lbrack k\rbrack},{\omega_{i}\lbrack k\rbrack}}{c_{0}\left( {{{\overset{\sim}{P}}^{req}\lbrack k\rbrack} - {\sum\limits_{i \in {\mathcal{C}\lbrack k\rbrack}}{P_{i}\lbrack k\rbrack}}} \right)}^{2}}\rightarrow\begin{matrix}{reference} \\{tracking}\end{matrix} \right.\left. \begin{matrix}{battery} \\{wearing}\end{matrix}\leftarrow\left\{ \begin{matrix}{+ {c_{1}\left( {{\sum\limits_{i \in {\mathcal{C}\lbrack k\rbrack}}{\left( {{P_{i}\lbrack k\rbrack} - {{\hat{P}}_{i}\lbrack k\rbrack}} \right)^{2}{\lambda_{i}\lbrack k\rbrack}}} +} \right.}} \\\left. {\sum\limits_{i \in {\mathcal{C}\lbrack k\rbrack}}{\left( {1 - {\omega_{i}\lbrack k\rbrack}} \right){\omega_{i}\left\lbrack {k - 1} \right\rbrack}{\rho_{i}\lbrack k\rbrack}{{\hat{P}}_{i}^{2}\lbrack k\rbrack}}} \right)\end{matrix} \right. \right.} & (11) \\\left. \begin{matrix}{fair} \\{allocation}\end{matrix}\leftarrow{+ {\sum\limits_{i \in {\mathcal{C}\lbrack k\rbrack}}\left( {{P_{i}\lbrack k\rbrack} - {P_{i}^{ref}\lbrack k\rbrack}} \right)^{2}}} \right. & (11) \\{{{s.t.P_{i}^{\min}}{\omega_{i}\lbrack k\rbrack}} \leq {P_{i}\lbrack k\rbrack} \leq {P_{i}^{\max}{\omega_{i}\lbrack k\rbrack}}} & (12) \\{{{\omega_{i}\lbrack k\rbrack} \in \left\{ {0,1} \right\}},{\forall{i \in {\mathcal{C}\lbrack k\rbrack}}}} & (13)\end{matrix}$ wherein {tilde over (P)}^(req)[k]=P^(req)[k]−

P_(i)[k], wherein

[k] is the collection of EVs that are locked at time k, whereinλ_(i)[k]∈[0.5, 1] per EV i, quantifies how long ago and how large powerchanges were, and${\lambda_{i}\lbrack k\rbrack} = \left\{ {\begin{matrix}{{{\lambda_{i}\left\lbrack k_{i}^{\prime} \right\rbrack} + {\left( \frac{❘{{{\hat{P}}_{i}\lbrack k\rbrack} - {{\hat{P}}_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}}}{P_{i}^{\max}} \right)\left( {1 - {\lambda_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}} \right)}},} \\{{{if}{❘{{{\hat{P}}_{i}\lbrack k\rbrack} - {P_{i}\left\lbrack k_{i}^{\prime} \right\rbrack}}❘}} > {{\epsilon{and}k} - k_{i}^{\prime}} < T^{L}} \\{{{\left( {{\lambda_{i}\left\lbrack {k - 1} \right\rbrack} - 0.5} \right)\delta} + 0.5},{otherwise}}\end{matrix}.} \right.$ wherein P_(i) ^(max) is a maximum power that EVi can consume and k_(i)′ is the time of the most recent change of thesetpoint for EV i before k, so that P_(i)[k]=P_(i)[k_(i)′] forx=k_(i)′,k_(i)′+1, . . . , k−1, and${\rho_{i}\lbrack k\rbrack} = {{0.5} + {{\zeta_{i}\lbrack k\rbrack}/{\left( {2\max\limits_{i \in {\mathcal{C}\lbrack k\rbrack}}{\zeta_{i}\lbrack k\rbrack}} \right).}}}$with the unit-less quantity per EV as follows${{\zeta_{i}\lbrack k\rbrack} = {s_{i}\frac{1}{P_{i}^{\max}}{H\left( {\frac{\Delta{E_{i}^{dem}\left\lbrack k_{i}^{arr} \right\rbrack}}{k_{i}^{dep} - k_{i}^{arr}},\ \frac{\Delta{E_{i}^{dem}\lbrack k\rbrack}}{k_{i}^{dep} - k}} \right)}}},$wherein the H represents the harmonic mean, and by property of theharmonic mean,${\zeta_{i}\lbrack k\rbrack} \in \left\lbrack {0,\ \frac{2s_{i}\Delta{E_{i}^{dem}\left\lbrack k_{i}^{arr} \right\rbrack}}{P_{i}^{\max}\left( {k_{i}^{dep} - k_{i}^{arr}} \right)}} \right\rbrack$which depend on an initial state of an EV, and moreover, ζ_(i)[k] ismonotonically increasing function of$\frac{\Delta{E_{i}^{dem}\lbrack k\rbrack}}{k_{i}^{dep} - k},$ whereinΔE_(i) ^(dem)[k] is the remaining energy demand of EV i at time k andexpected remaining charging k−k_(i) ^(dep), wherein s_(i)>0 is theparameter that differentiates service between classes of EVs, whereby atthe time k, reference powers, P_(i) ^(ref)[k]∈[0, P_(i) ^(max)] arecomputed for all EVs, ideally fair such that

P_(i) ^(ref)[k]=P^(req)[k], thereby minimizing an impact on battery lifeof EVs.
 2. The method of claim 1, further comprising formulating amixed-integer-quadratic program based on integral terms to cope withtime-dependent variables (ρ_(i),λ_(i)) such as battery wearing, andremaining energy demand.
 3. The method of claim 2, wherein an on/offdecision for EV i at time k is denoted by ω_(i)[k], and ω_(i)[k]=1(respectively, 0) means a decision to switch on (respectively, off) EV iat time k, and upon arrival, an EV is initially switched off, ω_(i)[k]being integer variables, the method further comprising introducing aranking metric r_(i)[k], which combines the operational margins withμ_(i)[k]: ${r_{i}\lbrack k\rbrack} = \left\{ {\begin{matrix}\frac{{\hat{P}}_{i}\lbrack k\rbrack}{P_{i}^{\max}{\mu_{i}\lbrack k\rbrack}} & {{{{if}\Delta{P^{req}\lbrack k\rbrack}} < 0},} \\\frac{P_{i}^{\max} - {{\hat{P}}_{i}\lbrack k\rbrack}}{P_{i}^{\max}{\mu_{i}\lbrack k\rbrack}} & {otherwise}\end{matrix},} \right.$ wherein ΔP^(req)[k]={tilde over (P)}^(req)[k]−

{circumflex over (P)}_(i)[k], implementing a heuristic configured toreduce the number of integer variables to m, thereby reducing acomplexity of the optimisation problem and enabling the solving of theoptimisation problem in real-time, whereby, if an amount of unlocked EVsis initially less than m≥1, then all these unlocked EVs are enabled tochange their on/off decision, and, otherwise, determined m EVs with alargest metric r_(i) are taken, whereby a heuristic partitions thecollection of unlocked EVs,

[k], into three collections: EVs that are forced to be switched orremain on (

^(on)[k]), EVs that are forced to be switched or remain off (

^(off)[k]), and EVs for which the on/off decision is decided by theoptimization problem (

[k]).
 4. The method of claim 1, wherein, if {tilde over (P)}^(req)[k] ∉[P^(lb), P^(ub)] the method comprises looping until fulfilling aconstraint of {tilde over (P)}^(req)[k]∈[P^(lb), P^(ub)], wherein${P^{lb} = {\sum\limits_{i \in {\mathcal{S}^{on}\lbrack k\rbrack}}P_{i}^{\min}}},{P^{ub} = {\sum\limits_{i \in {{\mathcal{S}^{on}\lbrack k\rbrack}\bigcup{\mathcal{S}\lbrack k\rbrack}}}{P_{t}^{\max}.}}}$5. The method of claim 4, whereby if {tilde over (P)}^(req)[k] liesabove the bounds [P^(lb), P^(ub)] the method comprises a step of forcingthe EV from

[k] with highest rank to be switched on, and replacing it with highestranked EV in

=

[k]\

[k], thereby automatically increasing P^(ub), to eventually reach {tildeover (P)}^(req)[k].
 6. The method of claim 4, whereby if {tilde over(P)}^(req)[k] lies below the bounds [P^(lb), P^(ub)] the methodcomprises a step of switching off the highest ranked EV from

[k], and replacing it with the highest ranked EV in

.